package gov.nhso.prov.acc.ftp;

import gov.nhso.prov.acc.beans.Acc67TransferDailyBean;
import gov.nhso.prov.acc.beans.Acc6ChequeBean;
import gov.nhso.prov.acc.beans.Acc6ChequeDetailBean;
import gov.nhso.prov.acc.beans.Acc6ExpenseBean;
import gov.nhso.prov.acc.beans.Acc6FtpBean;
import gov.nhso.prov.acc.beans.Acc6ProvinceAccountBean;
import gov.nhso.prov.acc.beans.Acc6TempChequeStmtBean;
import gov.nhso.prov.acc.beans.Acc6TransactionBean;
import gov.nhso.prov.acc.beans.Acc7ProvinceAccountBean;
import gov.nhso.prov.acc.core.DBConnection;
import gov.nhso.prov.acc.utils.DateUtil;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.commons.net.ftp.FTPClient;
import org.apache.commons.net.ftp.FTPFile;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.JobKey;

import com.isud.core.ISUD;
import com.isud.core.ISUDFactory;
import com.zehon.ftp.FTP;

@SuppressWarnings("rawtypes")
public class BAAC2NHSO extends FTPUtil implements Job {

	public BAAC2NHSO() {
	}

	public void execute(JobExecutionContext context)
			throws JobExecutionException {
		Connection conn = null;
		ISUD isud = null;
		try {
			conn = DBConnection.getConnection();
			isud = ISUDFactory.create(conn);
			JobKey jobKey = context.getJobDetail().getKey();
			System.out.println("BAAC2NHSO says: " + jobKey + " executing at "
					+ new Date());
			FTPClient client = new FTPClient();
			client.connect(this.ftpHost);

			try {

				boolean login = client.login(this.ftpUserId, this.ftpPasswd);

				if (login) {

					client.disconnect();

					System.out.println("File name > BAAC2NHSO");
					System.out.println("Process name >  execute");
					System.out.println("Line > 58");

					this.ftpBaac2NhsoTranfer(conn, isud);
					this.ftpBaac2NhsoCheque(conn, isud);
					this.ftpBaac2NhsoDailyStatement(conn, isud);
					this.cleanTransactionAccountType(conn, isud);

				}

				conn.commit();

			} catch (Exception ex) {

				System.out.println(" Error : " + ex.toString());
				ex.printStackTrace();

			} finally {

				try {

					if (client.isConnected()) {

						// Logout Client FTP
						client.logout();

						// Disconnection FTP
						client.disconnect();

					}

				} catch (Exception ex) {
					ex.printStackTrace();
				}

			}

		} catch (Exception e) {
			e.printStackTrace();
			try {
				if (conn != null) {
					conn.rollback();
				}
			} catch (SQLException eql) {
				eql.printStackTrace();
			}
		} finally {
			try {
				if (conn != null) {
					conn.close();
				}
				isud = null;
			} catch (SQLException e) {
				e.printStackTrace();
			}
		}
	}

	public void ftpBaac2NhsoTranfer(Connection conn, ISUD isud) {

	System.out.println("----------ftpBaac2NhsoTranfer---------");
		
		try {

			Acc6FtpBean afb = new Acc6FtpBean();
			afb.setFtpType("T");
			afb.setFtpStatus("W");
			List lsafb;
			lsafb = isud.selectList(afb);
			FTPClient client = new FTPClient();
			
			// Return Resource
			try {
			
			client.connect(this.ftpHost);
			client.login(this.ftpUserId, this.ftpPasswd);
			String remoteFolder = this.ftpBaac2NhsoTranfer + "/" + this.yyyy()+ "/" + this.mm() + "/";
			
			FTPFile[] arrF = client.listFiles(remoteFolder);
			List<String> fftp = new ArrayList<String>();

				for (int n = 0; n < arrF.length; n++) {
					FTPFile ff = arrF[n];
					if (!ff.getName().equals(".") && !ff.getName().equals("..")) {
						fftp.add(ff.getName());
					}
				}

				// Old
				// client.disconnect();

				for (int i = 0; i < lsafb.size(); i++) {
					
					afb = (Acc6FtpBean) lsafb.get(i);
					String nameOfFile = afb.getFileName() + ".OUT";
					InputStream in = null;
					
					try {
						
						if (fftp.contains(nameOfFile)) {
							
							in = FTP.getFileAsStream(nameOfFile, remoteFolder,this.ftpHost, this.ftpUserId,this.ftpPasswd);
							
							System.out.println(" InputStream : " + in.available());
							
							InputStreamReader is = new InputStreamReader(in,"TIS-620");
							
							BufferedReader br = new BufferedReader(is);

							try {

								String read = br.readLine();
								String reasonCode = "";
								String tsts = "";
								String s = "";
								String f = "";
								String o = "";
								
								while (read != null) {
								
									reasonCode = read.substring(85, 87);
									tsts = read.substring(287, 304);
									s = read.substring(52, 59);
									f = read.substring(59, 66);
									o = read.substring(66, 73);
									
									if (!tsts.trim().equals("")) {
									
										Acc6TransactionBean atb = new Acc6TransactionBean();
										atb.setTransactionTimestamp(this.setTimeStamp2DB(tsts));
										
										atb.setReasonCode(reasonCode);
										atb.setReasonDesc(" Charge : Service = "+ s.substring(0, 5)	+ "."	+ s.substring(5)	+ ", Fee = , "	+ f.substring(0, 5)	+ "."	+ f.substring(5)+ ", Other = "+ o.substring(0, 5)+ "."	+ o.substring(5));
										isud.update(atb);
									
										System.out.println(" Charge : Service = "+ s.substring(0, 5)	+ "."	+ s.substring(5)	+ ", Fee = , "	+ f.substring(0, 5)	+ "."	+ f.substring(5)+ ", Other = "+ o.substring(0, 5)+ "."	+ o.substring(5));
									}
									
									read = br.readLine();
								}
								
								// Old
							    is.close();
								
							    in.close();
							    
								afb.setFtpStatus("Y");
								afb.setFtpDesc("PROCESS FTP SUCCESS");

							} catch (Exception ex) {
								
								 	ex.printStackTrace();
									System.out.println("Error   : " + ex.toString());
							
							} finally {
							
								try {
									
									// Return Bubfer
									br.close();

									// Re
									is.close();

									// Return  resource  inputStream file
									in.close();
									
								} catch (Exception ex) {
										ex.printStackTrace();
										System.out.println("Error : " + ex.toString());
								} 
								
							}

						} else {
							afb.setFtpStatus("W");
							afb.setFtpDesc("inputStream null \"" + nameOfFile+ "\"");
						}

					} catch (Exception e) {
						
						afb.setFtpStatus("W");
						afb.setFtpDesc("PROCESS FTP NOT SUCCESS");
					
					} finally {
						
						try {
						
							if (in != null) {
								in.close();
							}
							
							afb.setCreatedDate("");
							afb.setCompletedDate("(SYSDATE)");
							isud.update(afb);

							String sql = "SELECT DOC_NO FROM " + this.schema + ".ACC6_EXPENSE WHERE EXPENSE_STATUS IN ('W','S') AND EXPENSE_TYPE = 'T'";
							List lsDocNo = isud.listDataSql(sql);
							
							for (int n = 0; n < lsDocNo.size(); n++) {
								Map map = (Map) lsDocNo.get(n);
								String docNo = isud.chkData(map.get("DOC_NO"));
								String num1 = isud
										.chkData(isud
												.findDataSql(
														"SELECT COUNT(*) AS NUM FROM "
																+ this.schema
																+ ".ACC6_EXPENSE_TRANSFER WHERE DOC_NO = '"
																+ docNo + "'")
												.get("NUM"));
								
								String num2 = isud
										.chkData(isud
												.findDataSql(
														"SELECT COUNT(*) AS NUM FROM "
																+ this.schema
																+ ".ACC6_EXPENSE_TRANSFER A, "
																+ this.schema
																+ ".ACC6_TRANSACTION B WHERE A.DOC_NO = '"
																+ docNo
																+ "' AND A.TRANSACTION_TIMESTAMP IS NOT NULL AND A.TRANSACTION_TIMESTAMP = B.TRANSACTION_TIMESTAMP AND B.REASON_CODE = '00' ")
												.get("NUM"));
								
								String num3 = isud
										.chkData(isud
												.findDataSql(
														"SELECT COUNT(*) AS NUM FROM "
																+ this.schema
																+ ".ACC6_EXPENSE_TRANSFER A, "
																+ this.schema
																+ ".ACC6_TRANSACTION B WHERE A.DOC_NO = '"
																+ docNo
																+ "' AND A.TRANSACTION_TIMESTAMP IS NOT NULL AND A.TRANSACTION_TIMESTAMP = B.TRANSACTION_TIMESTAMP AND (B.REASON_CODE <> '00' AND B.REASON_CODE IS NOT NULL) ")
												.get("NUM"));
								
								if (!num2.equals("0")) {
									
									Acc6ExpenseBean aeb = new Acc6ExpenseBean();
									aeb.setDocNo(docNo);
									if (num1.equals(num2)) {
										aeb.setExpenseStatus("Y");
									} else {
										aeb.setExpenseStatus("S");
									}
									aeb.setUpdatedBy("BAAC");
									aeb.setUpdatedDate("(SYSDATE)");
									isud.update(aeb);
									
								} else if (!num3.equals("0") && num1.equals(num3)) {
									
									Acc6ExpenseBean aeb = new Acc6ExpenseBean();
									aeb.setDocNo(docNo);
									aeb.setExpenseStatus("N");
									aeb.setUpdatedBy("BAAC");
									aeb.setUpdatedDate("(SYSDATE)");
									isud.update(aeb);
									
								}
							}

						} catch (IOException e) {
							e.printStackTrace();
						}
					}
					
				}

			} catch (Exception ex) {

				System.out.println("Error : " + ex.toString());
				ex.printStackTrace();

			} finally {

				// return resource 
				if (client.isConnected()) {

					// Logout FTP
					client.logout();

					// Disconnection FTP
					client.disconnect();

				}

			}

		} catch (Exception e1) {
			e1.printStackTrace();
		}

	}

	public void ftpBaac2NhsoCheque(Connection conn, ISUD isud) {

		try {

			Acc6ProvinceAccountBean apab = new Acc6ProvinceAccountBean();
			Acc6TransactionBean acc6TransactionBean = new Acc6TransactionBean();
			List lsafb;
			boolean result = false;
			String chequeNo = "";
			String chequeAmount = "";
			String chequeReceivingDate = "";
			String chequeType = "";
			String chqStmtKey = "";
			String errorCode = "";
			apab.setActive("Y");
			lsafb = isud.selectList(apab," AND PROVINCE_ACCOUNT_DAILY IS NOT NULL ");
			FTPClient client = new FTPClient();
			
			try  { 
			
			client.connect(this.ftpHost);
			client.login(this.ftpUserId, this.ftpPasswd);

			// Product
			String remoteFolder = this.ftpBaac2NhsoCheque + "/"+ this.yesterDay2() + "/";

			// Test
			// String remoteFolder = this.ftpBaac2NhsoCheque+"/20140312/";

			FTPFile[] f = client.listFiles(remoteFolder);
			List<String> fftp = new ArrayList<String>();

			for (int n = 0; n < f.length; n++) {
				FTPFile ff = f[n];
				if (!ff.getName().equals(".") && !ff.getName().equals("..")) {
					fftp.add(ff.getName());
				}
			}

			// Old
			// client.disconnect();
			
			StringBuffer sb = new StringBuffer();
			DateUtil du = new DateUtil();

			for (int x = 0; x < lsafb.size(); x++) {
				
				apab = (Acc6ProvinceAccountBean) lsafb.get(x);

				// Product
				String nameOfFile = "FZC009-" + apab.getProvinceAccountDaily()+ "-" + this.yesterDay2() + "-G001";

				// Test
				// String nameOfFile = "FZC009-" +
				// apab.getProvinceAccountDaily() + "-20140312-G001";
			
				InputStream in = null;
				String txtCondition = "";
				Map mapResult = new HashMap();

				int countResult = 0;

				try {

						if (fftp.contains(nameOfFile)) {

							in = FTP.getFileAsStream(nameOfFile, remoteFolder,this.ftpHost, this.ftpUserId,this.ftpPasswd);
							InputStreamReader is = new InputStreamReader(in,"TIS-620");
							BufferedReader br = new BufferedReader(is);
							String read = br.readLine();
							String[] splitStr = null;

							
							try {
								
								while (read != null) {
									
									splitStr = read.split("\\|");
									chequeType = isud.chkData(splitStr[14]).trim();
									errorCode = isud.chkData(splitStr[15]).trim();
									chequeNo = isud.chkData(splitStr[12]).trim();
									chequeAmount = isud.chkData(splitStr[13]).trim();
									chequeReceivingDate = du.changeDateToDB(this.changeFormatDate(isud.chkData(splitStr[3]).trim()));

									// Old
									// chqStmtKey =
									// isud.chkData(splitStr[3]).trim() +
									// isud.chkData(splitStr[4]).trim();

									// New add apab.getProvinceId() Add Prov
									// date : 26/03/2014
									chqStmtKey = apab.getProvinceId()+ isud.chkData(splitStr[3]).trim()+ isud.chkData(splitStr[4]).trim();

									// get data form Acc6Transaction &&
									// (chequeNo !=
									// null || !chequeNo.equals("null"))
									System.out.println("cheque line 238 :"	+ chequeNo + ":");

									if (errorCode != null && !errorCode.equals("E")) {

										if (chequeType.equals("D")) {

											result = false;

											acc6TransactionBean = new Acc6TransactionBean();
											acc6TransactionBean.setChequeNo(chequeNo);
											acc6TransactionBean.setExpenseAmount(chequeAmount);
											acc6TransactionBean.setProvinceId(apab.getProvinceId());

											Map<String, String> xcols = new HashMap<String, String>();

											xcols.put("TRANSACTION_TIMESTAMP","TO_CHAR(TRANSACTION_TIMESTAMP, 'YYYYMMDDHH24MISSFF3')");

											acc6TransactionBean = (Acc6TransactionBean) isud.select(acc6TransactionBean,xcols," AND REASON_CODE IS NULL ");

											Acc6TransactionBean atb = new Acc6TransactionBean();

											if (acc6TransactionBean.getTransactionTimestamp() != null) {

												atb.setChequeReceivingDate(chequeReceivingDate);
												atb.setReasonCode("00");
												atb.setChqStmtKey(chqStmtKey);
												atb.setTransactionTimestamp("TO_TIMESTAMP('"+ acc6TransactionBean.getTransactionTimestamp()+ "', 'YYYYMMDDHH24MISSFF3')");

												result = isud.update(atb," AND PROVINCE_ID = '"+ apab.getProvinceId()+ "' AND CHEQUE_NO = '"+ chequeNo+ "' AND REASON_CODE IS NULL ");

												isud.execDataSql("UPDATE "
														+ this.schema
														+ ".ACC6_EXPENSE_CHEQUE SET CHEQUE_RECEIVING_DATE = "
														+ chequeReceivingDate
														+ " WHERE CHEQUE_NO = '"
														+ chequeNo
														+ "' AND CHEQUE_AMOUNT = "
														+ chequeAmount
														+ " AND TRANSACTION_TIMESTAMP = TO_TIMESTAMP('"
														+ acc6TransactionBean
																.getTransactionTimestamp()
														+ "', 'YYYYMMDDHH24MISSFF3')");

												sb.setLength(0);
												sb.append("DELETE FROM "
														+ this.schema
														+ ".ACC6_TEMP_CHEQUE_STMT ");
												sb.append("WHERE PROVINCE_ID = '"
														+ apab.getProvinceId()
														+ "' AND CHEQUE_NO = '"
														+ chequeNo
														+ "' AND CHEQUE_AMOUNT = "
														+ chequeAmount + " ");
												sb.append("AND TRUNC(CHEQUE_RECEIVING_DATE) = "
														+ chequeReceivingDate
														+ " ");
												isud.execDataSql(sb.toString());

												System.out
														.println("sql line 262 :"
																+ sb.toString()
																+ ":");

											} else if (!chequeNo.equals("")) { // multiple
																				// cheque

												sb.setLength(0);
												sb.append("SELECT SUM_CHEQUE_AMOUNT ");
												sb.append("FROM " + this.schema
														+ ".ACC6_CHEQUE ");
												sb.append("WHERE PROVINCE_ID = '"
														+ apab.getProvinceId()
														+ "' AND CHEQUE_NO = '"
														+ chequeNo
														+ "' AND SUM_CHEQUE_AMOUNT = "
														+ chequeAmount + " ");
												sb.append("AND CHEQUE_STATUS = 'W' AND ACTIVE = 'Y' ");
												Map map = isud.findDataSql(sb
														.toString());

												System.out
														.println("sql line 270 :"
																+ sb.toString()
																+ ":");

												if (!isud
														.chkData(
																map.get("SUM_CHEQUE_AMOUNT"))
														.equals("")) {
													double sumChequeAmount = Double
															.parseDouble(map
																	.get("SUM_CHEQUE_AMOUNT")
																	.toString());
													double dChequeAmount = Double
															.parseDouble(chequeAmount);
													if (sumChequeAmount == dChequeAmount) {
														sb.setLength(0);
														sb.append("UPDATE "
																+ this.schema
																+ ".ACC6_TRANSACTION ");
														sb.append("SET CHEQUE_RECEIVING_DATE = "
																+ chequeReceivingDate
																+ ",REASON_CODE = '00',CHQ_STMT_KEY = '"
																+ chqStmtKey
																+ "' ");
														sb.append("WHERE PROVINCE_ID = '"
																+ apab.getProvinceId()
																+ "' AND CHEQUE_NO = '"
																+ chequeNo
																+ "'");
														System.out
																.println("sql line 279 :"
																		+ sb.toString()
																		+ ":");
														result = isud
																.execDataSql(sb
																		.toString());
														sb.setLength(0);
														sb.append("DELETE FROM "
																+ this.schema
																+ ".ACC6_TEMP_CHEQUE_STMT ");
														sb.append("WHERE PROVINCE_ID = '"
																+ apab.getProvinceId()
																+ "' AND CHEQUE_NO = '"
																+ chequeNo
																+ "' AND CHEQUE_AMOUNT = "
																+ chequeAmount
																+ " ");
														sb.append("AND TRUNC(CHEQUE_RECEIVING_DATE) = "
																+ chequeReceivingDate
																+ "");
														System.out
																.println("sql line 285 :"
																		+ sb.toString()
																		+ ":");
														isud.execDataSql(sb
																.toString());
													}
												}
											}

											// System.out.println("result >> " +
											// result);
											countResult = 0;
											sb.setLength(0);
											sb.append("SELECT COUNT(CHEQUE_NO) AS COUNT_CHEQUE_NO FROM "
													+ this.schema
													+ ".ACC6_TRANSACTION ");
											sb.append("WHERE PROVINCE_ID = '"
													+ apab.getProvinceId()
													+ "' AND CHEQUE_NO = '"
													+ chequeNo
													+ "' AND EXPENSE_AMOUNT = "
													+ chequeAmount + " ");
											sb.append("AND TRUNC(CHEQUE_RECEIVING_DATE) = "
													+ chequeReceivingDate + "");
											mapResult = isud.findDataSql(sb
													.toString());

											countResult = Integer
													.parseInt(isud.chkData(mapResult
															.get("COUNT_CHEQUE_NO")));

											if (countResult <= 0) {

												sb.setLength(0);
												sb.append("SELECT COUNT(CHEQUE_NO) AS COUNT_CHEQUE_NO FROM "
														+ this.schema
														+ ".ACC6_TRANSACTION ");
												sb.append("WHERE CHQ_STMT_KEY = '"
														+ chqStmtKey + "' ");
												mapResult = isud.findDataSql(sb
														.toString());
												countResult = Integer
														.parseInt(isud
																.chkData(mapResult
																		.get("COUNT_CHEQUE_NO")));

												if (countResult <= 0) {

													sb.setLength(0);
													sb.append("SELECT COUNT(PROVINCE_ID) AS COUNT_CHEQUE_NO FROM "
															+ this.schema
															+ ".ACC6_TEMP_CHEQUE_STMT ");
													sb.append("WHERE PROVINCE_ID = '"
															+ apab.getProvinceId()
															+ "' "
															+ txtCondition
															+ " AND CHEQUE_AMOUNT = "
															+ chequeAmount
															+ " ");
													sb.append("AND TRUNC(CHEQUE_RECEIVING_DATE) = "
															+ chequeReceivingDate
															+ " AND CHQ_STMT_KEY = '"
															+ chqStmtKey + "' ");
													mapResult = isud
															.findDataSql(sb
																	.toString());
													countResult = Integer
															.parseInt(isud
																	.chkData(mapResult
																			.get("COUNT_CHEQUE_NO")));

													if (!result
															&& countResult <= 0) {
														sb.delete(0,
																sb.length());
														sb.append("INSERT INTO "
																+ this.schema
																+ ".ACC6_TEMP_CHEQUE_STMT (PROVINCE_ID,CHEQUE_NO,CHEQUE_AMOUNT,CHEQUE_RECEIVING_DATE,CREATED_DATE,CHQ_STMT_KEY) ");
														sb.append("VALUES ('"
																+ apab.getProvinceId()
																+ "','"
																+ chequeNo
																+ "',"
																+ chequeAmount
																+ ","
																+ chequeReceivingDate
																+ ",(SYSDATE),'"
																+ chqStmtKey
																+ "') ");
														isud.execDataSql(sb
																.toString());
													}

												}
											}
										}
									}
									read = br.readLine();
								} // End  While Read file
							
							} catch (Exception ex) {
								ex.printStackTrace();

							} finally {

								br.close();

								is.close();
								
								in.close();
							}
						}
				} catch (Exception e) {
					System.out.println("printStackTrace Class BACC2NHSO Method ftpBaac2NhsoCheque");
					e.printStackTrace();
				} finally {
					try {
						if (in != null) {
							in.close();
						}
					} catch (IOException e) {
						e.printStackTrace();
					}
				}
			}

			Acc6TempChequeStmtBean tcs = new Acc6TempChequeStmtBean();
			lsafb = isud.selectList(tcs);

			if (lsafb.size() > 0) {

				du = new DateUtil();
				for (int i = 0; i < lsafb.size(); i++) {

					Acc6TempChequeStmtBean bean = (Acc6TempChequeStmtBean) lsafb
							.get(i);
					result = false;
					acc6TransactionBean = new Acc6TransactionBean();
					acc6TransactionBean.setProvinceId(bean.getProvinceId());
					acc6TransactionBean.setChequeNo(bean.getChequeNo());
					acc6TransactionBean
							.setExpenseAmount(bean.getChequeAmount());
					Map<String, String> xcols = new HashMap<String, String>();
					xcols.put("TRANSACTION_TIMESTAMP",
							"TO_CHAR(TRANSACTION_TIMESTAMP, 'YYYYMMDDHH24MISSFF3')");
					acc6TransactionBean = (Acc6TransactionBean) isud.select(
							acc6TransactionBean, xcols,
							" AND REASON_CODE IS NULL ");

					Acc6TransactionBean atb = new Acc6TransactionBean();
					if (acc6TransactionBean.getTransactionTimestamp() != null) {
						atb.setChequeReceivingDate("TO_DATE('"
								+ du.changeDateFromDB(
										bean.getChequeReceivingDate(), "")
								+ "','DD.MM.YYYY')");
						atb.setReasonCode("00");
						atb.setTransactionTimestamp("TO_TIMESTAMP('"
								+ acc6TransactionBean.getTransactionTimestamp()
								+ "', 'YYYYMMDDHH24MISSFF3')");
						result = isud.update(
								atb,
								" AND PROVINCE_ID = '" + bean.getProvinceId()
										+ "' AND CHEQUE_NO = '"
										+ bean.getChequeNo()
										+ "' AND REASON_CODE IS NULL ");
						if (result) {
							Map data = isud
									.findDataSql("SELECT DOC_NO FROM "
											+ this.schema
											+ ".ACC6_EXPENSE_CHEQUE WHERE CHEQUE_NO = '"
											+ bean.getChequeNo()
											+ "' AND CHEQUE_AMOUNT = "
											+ bean.getChequeAmount()
											+ " AND TRANSACTION_TIMESTAMP = TO_TIMESTAMP('"
											+ acc6TransactionBean
													.getTransactionTimestamp()
											+ "', 'YYYYMMDDHH24MISSFF3')");
							String docNo = isud.chkData(data.get("DOC_NO"));
							if (!docNo.equals("")) {
								isud.execDataSql("UPDATE "
										+ this.schema
										+ ".ACC6_EXPENSE_CHEQUE SET CHEQUE_RECEIVING_DATE = TO_DATE('"
										+ du.changeDateFromDB(
												bean.getChequeReceivingDate(),
												"")
										+ "','DD.MM.YYYY') WHERE CHEQUE_NO = '"
										+ bean.getChequeNo()
										+ "' AND CHEQUE_AMOUNT = "
										+ bean.getChequeAmount()
										+ " AND TRANSACTION_TIMESTAMP = TO_TIMESTAMP('"
										+ acc6TransactionBean
												.getTransactionTimestamp()
										+ "', 'YYYYMMDDHH24MISSFF3')");
								isud.execDataSql("DELETE "
										+ this.schema
										+ ".ACC6_TEMP_CHEQUE_STMT WHERE PROVINCE_ID = '"
										+ bean.getProvinceId()
										+ "' AND CHEQUE_NO='"
										+ bean.getChequeNo()
										+ "' AND CHEQUE_AMOUNT = "
										+ bean.getChequeAmount()
										+ " AND TRUNC(CHEQUE_RECEIVING_DATE) = TO_DATE('"
										+ du.changeDateFromDB(
												bean.getChequeReceivingDate(),
												"") + "','DD.MM.YYYY') ");
							}
						}
					} else {
						List ls = new ArrayList();
						Acc6ChequeBean acb = new Acc6ChequeBean();
						acb.setChequeNo(bean.getChequeNo());
						acb.setSumChequeAmount(bean.getChequeAmount());
						acb.setProvinceId(bean.getProvinceId());
						acb.setActive("Y");
						acb.setChequeStatus("W");
						isud.select(acb);
						if (acb.getDocNo() != null
								&& !acb.getDocNo().equals("")) {
							Acc6ChequeDetailBean acbd = new Acc6ChequeDetailBean();
							acbd.setDocNo(acb.getDocNo());
							xcols.put("TRANSACTION_TIMESTAMP",
									"TO_CHAR(TRANSACTION_TIMESTAMP, 'YYYYMMDDHH24MISSFF3')");
							ls = isud.selectList(acbd, xcols, "");
							for (int j = 0; j < ls.size(); j++) {
								atb = new Acc6TransactionBean();
								Acc6ChequeDetailBean acc6ChequeDetailBean = (Acc6ChequeDetailBean) ls
										.get(j);
								atb.setChequeReceivingDate("TO_DATE('"
										+ du.changeDateFromDB(
												bean.getCreatedDate(), "")
										+ "','DD.MM.YYYY')");
								atb.setReasonCode("00");
								atb.setTransactionTimestamp("TO_TIMESTAMP('"
										+ acc6ChequeDetailBean
												.getTransactionTimestamp()
										+ "', 'YYYYMMDDHH24MISSFF3')");
								result = isud.update(
										atb,
										" AND PROVINCE_ID = '"
												+ bean.getProvinceId()
												+ "' AND CHEQUE_NO = '"
												+ bean.getChequeNo()
												+ "' AND REASON_CODE IS NULL ");
							}
							if (result) {
								isud.execDataSql("UPDATE "
										+ this.schema
										+ ".ACC6_CHEQUE SET CHEQUE_RECEIVING_DATE = TO_DATE('"
										+ du.changeDateFromDB(
												bean.getChequeReceivingDate(),
												"")
										+ "','DD.MM.YYYY') WHERE DOC_NO = '"
										+ acb.getDocNo() + "' ");
								isud.execDataSql("DELETE "
										+ this.schema
										+ ".ACC6_TEMP_CHEQUE_STMT WHERE PROVINCE_ID = '"
										+ bean.getProvinceId()
										+ "' AND CHEQUE_NO='"
										+ bean.getChequeNo()
										+ "' AND CHEQUE_AMOUNT = "
										+ bean.getChequeAmount()
										+ " AND TRUNC(CHEQUE_RECEIVING_DATE) = TO_DATE('"
										+ du.changeDateFromDB(
												bean.getChequeReceivingDate(),
												"") + "','DD.MM.YYYY') ");
							}
						}
					}
				}
			}

			String sql = "SELECT DOC_NO FROM "
					+ this.schema
					+ ".ACC6_EXPENSE WHERE EXPENSE_STATUS IN ('W','S') AND EXPENSE_TYPE = 'C'";
			List lsDocNo = isud.listDataSql(sql);

			for (int n = 0; n < lsDocNo.size(); n++) {
				Map map = (Map) lsDocNo.get(n);
				String docNo = isud.chkData(map.get("DOC_NO"));
				String num1 = isud.chkData(isud.findDataSql(
						"SELECT COUNT(*) AS NUM FROM " + this.schema
								+ ".ACC6_EXPENSE_CHEQUE WHERE DOC_NO = '"
								+ docNo + "'").get("NUM"));
				String num2 = isud
						.chkData(isud
								.findDataSql(
										"SELECT COUNT(*) AS NUM FROM "
												+ this.schema
												+ ".ACC6_EXPENSE_CHEQUE A, "
												+ this.schema
												+ ".ACC6_TRANSACTION B WHERE A.DOC_NO = '"
												+ docNo
												+ "' AND A.TRANSACTION_TIMESTAMP IS NOT NULL AND A.TRANSACTION_TIMESTAMP = B.TRANSACTION_TIMESTAMP AND B.REASON_CODE = '00' ")
								.get("NUM"));
				String num3 = isud
						.chkData(isud
								.findDataSql(
										"SELECT COUNT(*) AS NUM FROM "
												+ this.schema
												+ ".ACC6_EXPENSE_CHEQUE A, "
												+ this.schema
												+ ".ACC6_TRANSACTION B WHERE A.DOC_NO = '"
												+ docNo
												+ "' AND A.TRANSACTION_TIMESTAMP IS NOT NULL AND A.TRANSACTION_TIMESTAMP = B.TRANSACTION_TIMESTAMP AND (B.REASON_CODE <> '00' AND B.REASON_CODE IS NOT NULL) ")
								.get("NUM"));
				if (!num2.equals("0")) {
					Acc6ExpenseBean aeb = new Acc6ExpenseBean();
					aeb.setDocNo(docNo);
					if (num1.equals(num2)) {
						aeb.setExpenseStatus("Y");
					} else {
						aeb.setExpenseStatus("S");
					}
					aeb.setUpdatedBy("BAAC");
					aeb.setUpdatedDate("(SYSDATE)");
					isud.update(aeb);
				} else if (!num3.equals("0") && num1.equals(num3)) {
					Acc6ExpenseBean aeb = new Acc6ExpenseBean();
					aeb.setDocNo(docNo);
					aeb.setExpenseStatus("N");
					aeb.setUpdatedBy("BAAC");
					aeb.setUpdatedDate("(SYSDATE)");
					isud.update(aeb);
				}
			}

			sql = "SELECT DOC_NO,SUM_CHEQUE_AMOUNT,PROVINCE_ID,CHEQUE_NO FROM "
					+ this.schema + ".ACC6_CHEQUE WHERE CHEQUE_STATUS = 'W' ";
			sb = new StringBuffer();
			lsDocNo = isud.listDataSql(sql);

			for (int n = 0; n < lsDocNo.size(); n++) {
				Map map = (Map) lsDocNo.get(n);
				chequeNo = isud.chkData(map.get("CHEQUE_NO"));
				String docNo = isud.chkData(map.get("DOC_NO"));
				String provinceId = isud.chkData(map.get("PROVINCE_ID"));
				String sumChequeAmount1 = isud.chkData(map
						.get("SUM_CHEQUE_AMOUNT"));
				String sumChequeAmount2 = isud
						.chkData(isud
								.findDataSql(
										"SELECT SUM(CHEQUE_AMOUNT) AS SUM_CHEQUE_AMOUNT FROM "
												+ this.schema
												+ ".ACC6_CHEQUE_DETAIL A, "
												+ this.schema
												+ ".ACC6_TRANSACTION B WHERE A.DOC_NO = '"
												+ docNo
												+ "' AND A.TRANSACTION_TIMESTAMP IS NOT NULL AND A.TRANSACTION_TIMESTAMP = B.TRANSACTION_TIMESTAMP AND B.REASON_CODE = '00' ")
								.get("SUM_CHEQUE_AMOUNT"));
				if (sumChequeAmount1.equals(sumChequeAmount2)) {

					// get CHEQUE_RECEIVING_DATE from table Acc6Transaction
					sb.setLength(0);
					sb.append("SELECT DISTINCT CHEQUE_RECEIVING_DATE ");
					sb.append("FROM " + this.schema + ".ACC6_TRANSACTION ");
					sb.append("WHERE CHEQUE_NO = '" + chequeNo
							+ "' AND PROVINCE_ID = '" + provinceId + "' ");
					sb.append("AND REASON_CODE = '00' ");

					Map mapChequeReceivingDate = isud
							.findDataSql(sb.toString()); // CHEQUE_RECEIVING_DATE

					if (!isud
							.chkData(
									mapChequeReceivingDate
											.get("CHEQUE_RECEIVING_DATE"))
							.equals("")) {
						Acc6ChequeBean acb = new Acc6ChequeBean();
						acb.setDocNo(docNo);
						acb.setChequeStatus("Y");
						acb.setUpdatedDate("(SYSDATE)");
						acb.setUpdatedBy("BAAC");
						acb.setChequeReceivingDate("TO_DATE('"
								+ du.changeDateFromDB(mapChequeReceivingDate
										.get("CHEQUE_RECEIVING_DATE")
										.toString(), "") + "','DD.MM.YYYY')");
						isud.update(acb);
					}

				}
			}

			System.out.println(" ======= Start printMessage BAAC2NHSO ======= ");
			isud.printMessage();
			System.out.println(" ======= End printMessage BAAC2NHSO ======= ");

			} catch (Exception ex){ 
				 System.out.println(" Error : " + ex.toString());
				 ex.printStackTrace();
			} finally { 
				 
				try { 
					
					if(client.isConnected()) {
					
						// Return Logout 
						client.logout(); 
						
						// Return Disconnect
						client.disconnect();
						
					}
					 
				 }catch (Exception ex ){ 
					 ex.printStackTrace();
				 }
				
			}
			
		} catch (Exception e1) {
			e1.printStackTrace();
		}
	}

	public void ftpBaac2NhsoDailyStatement(Connection conn, ISUD isud) {

		try {

			Acc6ProvinceAccountBean apab6 = new Acc6ProvinceAccountBean();
			Acc7ProvinceAccountBean apab7 = new Acc7ProvinceAccountBean();
			Acc67TransferDailyBean atdb = new Acc67TransferDailyBean();

			StringBuffer sb = new StringBuffer();
			List lsafb;
			Map map = new HashMap();
			apab6.setActive("Y");
			lsafb = isud.selectList(apab6);

			FTPClient client = new FTPClient();
			
			try { 

			client.connect(this.ftpHost);
			client.login(this.ftpUserId, this.ftpPasswd);

			// Test
			// String remoteFolder = this.ftpBaac2NhsoCheque + "/20140328/";
			// //for test

			// Product
			String remoteFolder = this.ftpBaac2NhsoCheque + "/"+ this.yesterDay2() + "/";

			FTPFile[] f = client.listFiles(remoteFolder);

			System.out.println(" remote folder : " + remoteFolder + " f size : " + f.length);

			List<String> fftp = new ArrayList<String>();
			for (int n = 0; n < f.length; n++) {
				FTPFile ff = f[n];
				if (!ff.getName().equals(".") && !ff.getName().equals("..")) {
					fftp.add(ff.getName());
				}
			}

			client.disconnect();

			// Account 6
			String accountNumber = "";// 2
			String transferDate = "";// 10
			String transactionCode = "";// 11
			String chequeNo = ""; // 12
			String amount = "";// 13
			String transferType = "";// 14
			String remain = "";// 16
			String date = "";
			String[] strArr = null;
			String dd = "";
			String mm = "";
			String yyyy = "";
			String transferDailyKey = "";
			String[] splitStr = null;

			// ออมทรัพย์
			for (int x = 0; x < lsafb.size(); x++) {
				apab6 = (Acc6ProvinceAccountBean) lsafb.get(x);

				// Product
				String nameOfFile = "FZC009-"+ apab6.getProvinceAccountSaving() + "-"+ this.yesterDay2() + "-G001";

				// Test
				// String nameOfFile = "FZC009-" +
				// apab6.getProvinceAccountSaving() + "-20140312-G001"; // for
				// test

				// System.out.println("file name on server  >>> " + nameOfFile);

				InputStream in = null;

				try {

					if (fftp.contains(nameOfFile)) {

						in = FTP.getFileAsStream(nameOfFile, remoteFolder,this.ftpHost, this.ftpUserId, this.ftpPasswd);
						InputStreamReader is = new InputStreamReader(in,"TIS-620");
						BufferedReader br = new BufferedReader(is);
						String read = br.readLine();

						while (read != null) {

							splitStr = read.split("\\|");
							atdb = new Acc67TransferDailyBean();
							date = this.changeFormatDate2AD(isud.chkData(splitStr[10]));
							strArr = date.split("\\/");
							mm = strArr[1];
							yyyy = strArr[2];
							String lastOfMonth = this.getLastOfMonth(yyyy, mm);

							date = this.changeFormatDate2AD(isud.chkData(splitStr[10]));
							strArr = date.split("\\/");
							dd = strArr[0];
							mm = strArr[1];
							yyyy = strArr[2];
							date = yyyy + mm + dd;

							accountNumber = isud.chkData(splitStr[2]);
							transferDate = this.changeFormatDate2YYYYMMDDD(isud
									.chkData(splitStr[10]));
							transactionCode = isud.chkData(splitStr[11]);

							amount = isud.chkData(splitStr[13]);
							transferType = isud.chkData(splitStr[14]);
							remain = isud.chkData(splitStr[16]);
							atdb.setProvinceId(apab6.getProvinceId());
							atdb.setProvinceName(apab6.getProvinceName());
							atdb.setTransferDailyAcc("6");
							atdb.setAccountNumber(accountNumber);
							atdb.setAccountType("S");
							atdb.setTransferDate(transferDate);
							atdb.setTransactionCode(transactionCode.trim());
							atdb.setAmount(amount);
							atdb.setTransferType(transferType);
							atdb.setRemain(remain);

							read = br.readLine();

							if (read == null && date.equals(lastOfMonth)) {
								atdb.setLastFieldOfMonth("Y");
							} else {
								atdb.setLastFieldOfMonth("N");
							}

							transferDailyKey = apab6.getProvinceId() + isud.chkData(splitStr[3])+ isud.chkData(splitStr[4]);
							
							
							atdb.setTransferDailyKey(transferDailyKey);
							sb.setLength(0);

							sb.append("SELECT COUNT(TRANSFER_DAILY_KEY) AS COUNT_DATA FROM "+ this.schema+ ".ACC67_TRANSFER_DAILY WHERE TRANSFER_DAILY_KEY = "	+ transferDailyKey);

							map = isud.findDataSql(sb.toString());

							if (Integer.parseInt(isud.chkData(map.get("COUNT_DATA"))) == 0) {
								isud.insert(atdb);
							}

						}

						is.close();
						
						in.close();
						
					}

				} catch (Exception e) {
					System.out.println("printStackTrace Class BACC2NHSO Method ftpBaac2NhsoDailyStatement Acc6");
					e.printStackTrace();
				} finally {
					try {
						if (in != null) {
							in.close();
						}
					} catch (IOException e) {
						e.printStackTrace();
					}
				}
			}

			// System.out.println(" -- Start Process Accoutn Daily --- ");

			// กระแสรายวัน
			for (int x = 0; x < lsafb.size(); x++) {

				apab6 = (Acc6ProvinceAccountBean) lsafb.get(x);

				// Product
				String nameOfFile = "FZC009-" + apab6.getProvinceAccountDaily() + "-" + this.yesterDay2() + "-G001";

				// if(!apab6.getProvinceAccountDaily().equals(null) ){

				// Test
				// String nameOfFile = "FZC009-" +
				// apab6.getProvinceAccountDaily() + "-20140328-G001"; // for
				// test
				// System.out.println("File name : " + nameOfFile);

				InputStream in = null;

				try {

					if (fftp.contains(nameOfFile)) {

						// System.out.println(";; Have file in folder ");

						in = FTP.getFileAsStream(nameOfFile, remoteFolder, this.ftpHost, this.ftpUserId, this.ftpPasswd);

						InputStreamReader is = new InputStreamReader(in,"TIS-620");
						BufferedReader br = new BufferedReader(is);
						String read = br.readLine();

						while (read != null) {

							splitStr = read.split("\\|");
							atdb = new Acc67TransferDailyBean();

							date = this.changeFormatDate2AD(isud.chkData(splitStr[10]));
							strArr = date.split("\\/");
							mm = strArr[1];
							yyyy = strArr[2];
							String lastOfMonth = this.getLastOfMonth(yyyy, mm);

							date = this.changeFormatDate2AD(isud.chkData(splitStr[10]));
							strArr = date.split("\\/");
							dd = strArr[0];
							mm = strArr[1];
							yyyy = strArr[2];
							date = yyyy + mm + dd;

							accountNumber = isud.chkData(splitStr[2]);
							transferDate = this.changeFormatDate2YYYYMMDDD(isud.chkData(splitStr[10]));
							transactionCode = isud.chkData(splitStr[11]);
							chequeNo = isud.chkData(splitStr[12]);
							amount = isud.chkData(splitStr[13]);
							transferType = isud.chkData(splitStr[14]);
							atdb.setProvinceId(apab6.getProvinceId());
							atdb.setProvinceName(apab6.getProvinceName());
							atdb.setTransferDailyAcc("6");
							atdb.setAccountNumber(accountNumber);
							atdb.setAccountType("D");
							atdb.setTransferDate(transferDate);
							atdb.setTransactionCode(transactionCode.trim());
							atdb.setChequeNo(chequeNo);
							atdb.setAmount(amount);
							atdb.setTransferType(transferType);
							atdb.setRemain("0");
							read = br.readLine();

							if (read == null && date.equals(lastOfMonth)) {
								atdb.setLastFieldOfMonth("Y");
							} else {
								atdb.setLastFieldOfMonth("N");
							}

							// Product
							transferDailyKey = apab6.getProvinceId()+ isud.chkData(splitStr[3])+ isud.chkData(splitStr[4]);

							// Test
							// transferDailyKey = isud.chkData(splitStr[3]) +
							// isud.chkData(splitStr[4]);

							atdb.setTransferDailyKey(transferDailyKey);
							sb.setLength(0);

							// Product
							sb.append("SELECT COUNT(TRANSFER_DAILY_KEY) AS COUNT_DATA FROM "+ this.schema+ ".ACC67_TRANSFER_DAILY WHERE TRANSFER_DAILY_KEY = "+ transferDailyKey);

							// Dev
							// sb.append("SELECT COUNT(TRANSFER_DAILY_KEY) AS COUNT_DATA FROM "
							// + this.schema +
							// ".ACC67_TRANSFER_DAILY WHERE TRANSFER_DAILY_KEY = '"
							// + transferDailyKey + "'" );

							// System.out.println(sb.toString());

							map = isud.findDataSql(sb.toString());

							// System.out.println("data check berfor update : "
							// + map.get("COUNT_DATA").toString());

							if (Integer.parseInt(isud.chkData(map.get("COUNT_DATA"))) == 0) {

								if (splitStr[14].equals("D")
										&& splitStr[15].equals("E")) {
								} else {
									isud.insert(atdb);
								}

								// System.out.println("---- Insert Transaction complete ----");

							}

						} // end wile read file

						is.close();

						in.close();
						
					} // end if check file have data

				} catch (Exception e) {
					System.out.println("Error  >>>> " + e);
					System.out
							.println("printStackTrace Class BACC2NHSO Method ftpBaac2NhsoDailyStatement Acc6");
					System.out.println("Msg Error : " + e.toString());
					e.printStackTrace();
				} finally {
					try {
						if (in != null) {
							in.close();
						}
					} catch (IOException e) {
						e.printStackTrace();
					}
				}
			}

			apab7.setActive("Y");
			lsafb = isud.selectList(apab7);

			// Account 7
			for (int x = 0; x < lsafb.size(); x++) {

				apab7 = (Acc7ProvinceAccountBean) lsafb.get(x);
				String nameOfFile = "FZC009-" + apab7.getProvinceAccount()+ "-" + this.yesterDay2() + "-G001";

				// String nameOfFile = "FZC009-" + apab7.getProvinceAccount() +
				// "-20140210-G001"; // for test
				// System.out.println("nameOfFile Account 7 >> " + nameOfFile);
				InputStream in = null;

				try {

					if (fftp.contains(nameOfFile)) {

						in = FTP.getFileAsStream(nameOfFile, remoteFolder,this.ftpHost, this.ftpUserId, this.ftpPasswd);
						InputStreamReader is = new InputStreamReader(in,"TIS-620");
						BufferedReader br = new BufferedReader(is);
						String read = br.readLine();
						
						try { 
						
						// String[] splitStr = null;

							while (read != null) {
	
								splitStr = read.split("\\|");
								atdb = new Acc67TransferDailyBean();
								date = this.changeFormatDate2AD(isud.chkData(splitStr[10]));
								strArr = date.split("\\/");
								mm = strArr[1];
								yyyy = strArr[2];
								String lastOfMonth = this.getLastOfMonth(yyyy, mm);
	
								date = this.changeFormatDate2AD(isud.chkData(splitStr[10]));
								strArr = date.split("\\/");
								dd = strArr[0];
								mm = strArr[1];
								yyyy = strArr[2];
								date = yyyy + mm + dd;
	
								accountNumber = isud.chkData(splitStr[2]);
								transferDate = this.changeFormatDate2YYYYMMDDD(isud.chkData(splitStr[10]));
								transactionCode = isud.chkData(splitStr[11]);
								amount = isud.chkData(splitStr[13]);
								transferType = isud.chkData(splitStr[14]);
								remain = isud.chkData(splitStr[16]);
								atdb.setProvinceId(apab7.getProvinceId());
								atdb.setProvinceName(apab7.getProvinceName());
								atdb.setTransferDailyAcc("7");
								atdb.setAccountNumber(accountNumber);
								atdb.setAccountType("S");
								atdb.setTransferDate(transferDate);
								atdb.setTransactionCode(transactionCode.trim());
								atdb.setAmount(amount);
								atdb.setTransferType(transferType);
								atdb.setRemain(remain);
								read = br.readLine();
	
								if (read == null && date.equals(lastOfMonth)) {
									atdb.setLastFieldOfMonth("Y");
								} else {
									atdb.setLastFieldOfMonth("N");
								}
	
								transferDailyKey = apab7.getProvinceId()+ isud.chkData(splitStr[3])+ isud.chkData(splitStr[4]);
								atdb.setTransferDailyKey(transferDailyKey);
								sb.setLength(0);
								sb.append("SELECT COUNT(TRANSFER_DAILY_KEY) AS COUNT_DATA FROM "+ this.schema+ ".ACC67_TRANSFER_DAILY WHERE TRANSFER_DAILY_KEY = "+ transferDailyKey);
								map = isud.findDataSql(sb.toString());
	
								if (Integer.parseInt(isud.chkData(map.get("COUNT_DATA"))) == 0) {
									isud.insert(atdb);
								}
	
							} // End Read data file
						
						} catch (Exception ex ){
							 
							ex.printStackTrace();
							 
						} finally {
							
							// Return  Bubfer
							br.close();
							
							// Return Stream
							is.close();
							
							// Retur InputStreamFile
							in.close();
							
						}
					}
					
				} catch (Exception e) {
					System.out.println("printStackTrace Class BACC2NHSO Method ftpBaac2NhsoDailyStatement Acc7");
					e.printStackTrace();
					isud.printMessage();
				} finally {
					try {
						if (in != null) {
							in.close();
						}
					} catch (IOException e) {
						e.printStackTrace();
					}
				}
			}
			
			} catch (Exception ex) { 
			
				System.out.println("Error : " + ex.toString());
				ex.printStackTrace();
			
			} finally { 
				
				try{ 
				
						 if(client.isConnected()){ 
							 
							  client.logout();
							  
							  client.disconnect();
							 
						 }
					
				} catch (Exception ex){ 
					  ex.printStackTrace();
				}
				
			}
			
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	/**
	 * @description delete current account.
	 * @param conn
	 * @param isud
	 * @return
	 */
	public boolean cleanTransactionAccountType(Connection conn, ISUD isud) {

		boolean action = false;

		try {

			String sql = "DELETE FROM "
					+ this.schema
					+ ".ACC67_TRANSFER_DAILY WHERE TRANSFER_DAILY_ACC='6' and ACCOUNT_TYPE='D' and  transfer_type='C' ";

			if (isud.execDataSql(sql)) {
				action = true;
			}

		} catch (Exception e) {
			e.printStackTrace();
		}

		return action;

	}

}
